<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
    <link rel="stylesheet" href="https://jqweui.cn/dist/demos/css/demos.css">
</head>

<body>
    <header class='demos-header'>
        <h2 class="demos-second-title"></h2>
        <p class="demos-sub-title">By 言川 @2016/03/30</p>
    </header>
    <article class="weui-article">

    </article>
    <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
    <script>
        $.ajax({
            url: "http://123.206.221.45/Api/getArticleContent",
            type: 'GET',
            dataType: "jsonp",
            data: "id=" + getQueryString("id"),
            success: function (data) {
                if (data.code == 0) {
                    $(".demos-second-title").html(data.data[0].title)
                    $(".demos-sub-title").html("By " + data.data[0].nikename + " @" + data.data[0].time)
                    $(".weui-article").append(data.data[0].content)



                } else alert("服务器错误:" + data.msg);
            }
        });
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }
    </script>
</body>

</html>